//这个redux判断
const INPUT_TEXT = "input_message";

//reducer
export function inputMessage(state = {
    message: '暂无信息'
}, action) {
    switch(action.type) {
        case INPUT_TEXT:
            return { ...state,
                message: action.msg ? action.msg : '暂无信息'
            };
        default:
            return state;    
    }
}

//action creator
export function showInputMessage(msg) {
    return {
        type: INPUT_TEXT,
        msg: msg
    }
}